package pack3;

lass People{ 
    private int code; 
    private String name; 
    private char sex; 
People(int code, String name, char sex){ 
    setCode(code); 
    setName(name); 
    setSex(sex); 
} 
int getCode(){ 
    return code; 
} 
String getName(){ 
    return name; 
} 
char getSex(){ 
    return sex; 
} 
void setCode(int code){ 
    this.code = code; 
} 
void setName(String name){ 
    this.name = name; 
} 
void setSex(char sex){ 
    this.sex = sex; 
} 
} 
  
public class Student extends People {
 public Teacher name;
 public Course b;
 public boolean choose;

 public Student(int code, String name, char sex, Teacher t, Course c,boolean choose) {
  super(code, name, sex );
  this.name = t;
  this.b = c;
  this.choose=choose;
 }
    public boolean getAll() {
     return choose;
    }
 public String toString() {
  return "学生编号:" + getCode() + "学生姓名:" + getName() + "性别:" + getSex() + "授课老师：" + name.name + this.b ;
 }
}